from selenium import webdriver
from selenium.webdriver.common.by import By
import time
url = 'https://qzone.qq.com/'
driver = webdriver.Edge()
driver.get(url)
# 切换框架
# 方式一,用id直接登录
driver.switch_to.frame('login_frame')
# 方式二，用xpath定位框架
# el_frame = driver.find_element(By.XPATH, '//*[@id="login_frame"]')
# driver.switch_to.frame(el_frame)

driver.find_element(By.ID, 'switcher_plogin').click()
driver.find_element(By.ID, 'u').send_keys('2996955548')
driver.find_element(By.ID, 'p').send_keys('qweljw041013')
driver.find_element(By.ID, 'login_button').click()
time.sleep(9)